home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-02-14 | 7.0 KB | 327 lines | [TEXT/MPS ] |
- /*------------------------------------------------------------------------------
- #
- # Apple Products Presents
- #
- # S U R F E R ----- A CommToolbox Sample Application
- # by Alex Kazim
- #
- # Based on the MacDTS Simple Sample Application
- #
- # Surfer.r - Rez Source
- #
- # Copyright © 1988-9 Apple Computer, Inc.
- # All rights reserved.
- #
- # Versions: Sample 1.0 08/88
- # Sample 1.01 11/88
- # Surfer 0.5 08/89
- # Surfer 1.01 02/90
- ------------------------------------------------------------------------------*/
-
-
- #include "Types.r"
- #include "SysTypes.r"
- #include "Surfer.h"
-
-
- /* So the Finder can tell who we are */
-
- resource 'vers' (1) {
- 0x01,
- 0x00,
- development,
- 0x12,
- verUS,
- "1.01",
- "1.01, Copyright © Apple Computer, Inc. 1988-1990. Written by Alex Kazim"
- };
-
-
- /* we use an MBAR resource to conveniently load all the menus */
-
- resource 'MBAR' (rMenuBar, preload) {
- { mApple, mFile, mEdit, mSettings }; /* four menus */
- };
-
-
- resource 'MENU' (mApple, preload) {
- mApple, textMenuProc,
- AllItems & ~MenuItem2, /* Disable dashed line, enable About and DAs */
- enabled, apple,
- {
- "About Surfer…",
- noicon, nokey, nomark, plain;
- "-",
- noicon, nokey, nomark, plain
- }
- };
-
- resource 'MENU' (mFile, preload) {
- mFile, textMenuProc,
- MenuItem15, /* enable Quit only, program enables others */
- enabled, "File",
- {
- "New",
- noicon, "N", nomark, plain;
- "Open",
- noicon, "O", nomark, plain;
- "-",
- noicon, nokey, nomark, plain;
- "Close",
- noicon, "W", nomark, plain;
- "Save",
- noicon, "S", nomark, plain;
- "Save As…",
- noicon, nokey, nomark, plain;
- "Revert",
- noicon, nokey, nomark, plain;
- "-",
- noicon, nokey, nomark, plain;
- "Send File",
- noicon, "T", nomark, plain;
- "Receive File",
- noicon, "R", nomark, plain;
- "-",
- noicon, nokey, nomark, plain;
- "Page Setup…",
- noicon, nokey, nomark, plain;
- "Print…",
- noicon, nokey, nomark, plain;
- "-",
- noicon, nokey, nomark, plain;
- "Quit",
- noicon, "Q", nomark, plain
- }
- };
-
- resource 'MENU' (mEdit, preload) {
- mEdit, textMenuProc,
- NoItems, /* disable everything, program does the enabling */
- enabled, "Edit",
- {
- "Undo",
- noicon, "Z", nomark, plain;
- "-",
- noicon, nokey, nomark, plain;
- "Cut",
- noicon, "X", nomark, plain;
- "Copy",
- noicon, "C", nomark, plain;
- "Paste",
- noicon, "V", nomark, plain;
- "Clear",
- noicon, nokey, nomark, plain
- }
- };
-
- resource 'MENU' (mSettings, preload) {
- mSettings, textMenuProc,
- NoItems, /* disable everything, program does the enabling */
- enabled, "Settings",
- {
- "Connection…",
- noicon, "1", nomark, plain;
- "File Transfer…",
- noicon, "2", nomark, plain;
- "Terminal…",
- noicon, "3", nomark, plain
- }
- };
-
-
- /* this ALRT and DITL are used as an About screen */
-
- resource 'ALRT' (rAboutAlert, purgeable) {
- {40, 20, 180, 400},
- rAboutAlert,
- { /* array: 4 elements */
- /* [1] */
- OK, visible, silent,
- /* [2] */
- OK, visible, silent,
- /* [3] */
- OK, visible, silent,
- /* [4] */
- OK, visible, silent
- }
- };
-
- resource 'DITL' (rAboutAlert, purgeable) {
- { /* array DITLarray: 5 elements */
- /* [1] */
- {99, 285, 119, 365},
- Button {
- enabled,
- "OK"
- },
- /* [2] */
- {8, 8, 26, 250},
- StaticText {
- disabled,
- "SURFER: A CommToolbox Application"
- },
- /* [3] */
- {103, 6, 120, 251},
- StaticText {
- disabled,
- "Copyright © 1988-90 Apple Computer."
- },
- /* [4] */
- {52, 8, 69, 204},
- StaticText {
- disabled,
- "Bytes by Alex, Words by Rob"
- },
- /* [5] */
- {86, 6, 103, 211},
- StaticText {
- disabled,
- "Based on Sample from MacDTS"
- }
- }
- };
-
-
- /* this ALRT and DITL are used as an error screen */
-
- resource 'ALRT' (rUserAlert, purgeable) {
- {40, 20, 180, 350},
- rUserAlert,
- { /* array: 4 elements */
- /* [1] */
- OK, visible, silent,
- /* [2] */
- OK, visible, silent,
- /* [3] */
- OK, visible, silent,
- /* [4] */
- OK, visible, silent
- }
- };
-
-
- resource 'DITL' (rUserAlert, purgeable) {
- { /* array DITLarray: 3 elements */
- /* [1] */
- {100, 230, 120, 310},
- Button {
- enabled,
- "OK"
- },
- /* [2] */
- {10, 60, 76, 310},
- StaticText {
- disabled,
- "^0"
- },
- /* [3] */
- {8, 8, 40, 40},
- Icon {
- disabled,
- 2
- }
- }
- };
-
-
- resource 'WIND' (rWindow, preload, purgeable) {
- {40, 5, 340, 512},
- noGrowDocProc, visible, noGoAway, 0x0, "Surf the Wave"
- };
-
-
- /* we put the latest SIZE template here so we can rez with MPW 2.0 */
-
- type 'SIZE' {
- boolean dontSaveScreen,
- saveScreen;
- boolean ignoreSuspendResumeEvents,
- acceptSuspendResumeEvents;
- boolean enableOptionSwitch,
- disableOptionSwitch;
- boolean cannotBackground,
- canBackground;
- boolean notMultiFinderAware,
- multiFinderAware;
- boolean notOnlyBackground,
- onlyBackground;
- boolean dontGetFrontClicks,
- getFrontClicks;
- unsigned bitstring[9] = 0;
- unsigned longint; /* preferred memory size in bytes */
- unsigned longint; /* minimum memory size in bytes */
- }; /* ignore the warning caused by re-defining SIZE */
-
-
- /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
-
- resource 'SIZE' (-1) {
- dontSaveScreen,
- acceptSuspendResumeEvents,
- enableOptionSwitch,
- canBackground, /* we can background; we don't currently, but our sleep value */
- /* guarantees we don't hog the Mac while we are in the background */
- multiFinderAware, /* this says we do our own activate/deactivate; don't fake us out */
- notOnlyBackground, /* this is definitely not a background-only application! */
- dontGetFrontClicks, /* change this is if you want "do first click" behavior like the Finder */
- kPrefSize * 1024,
- kMinSize * 1024
- };
-
-
- resource 'BNDL' (rBNDL) {
- 'SurF',
- 0,
- { /* array TypeArray: 2 elements */
- /* [1] */
- 'FREF',
- { /* array IDArray: 1 elements */
- /* [1] */
- 0, 128
- },
- /* [2] */
- 'ICN#',
- { /* array IDArray: 1 elements */
- /* [1] */
- 0, 128
- }
- }
- };
-
- data 'SurF' (0, "Owner resource") {
- $"3B 43 6F 70 79 72 69 67 68 74 20 31 39 38 38 2D" /* ;Copyright 1988- */
- $"39 30 20 41 70 70 6C 65 20 43 6F 6D 70 75 74 65" /* 90 Apple Compute */
- $"72 20 49 6E 63 2E 20 20 41 6C 6C 20 52 69 67 68" /* r Inc. All Righ */
- $"74 73 20 52 65 73 65 72 76 65 64 2E" /* ts Reserved. */
- };
-
- resource 'FREF' (rBNDL) {
- 'APPL',
- 0,
- ""
- };
-
- resource 'ICN#' (rBNDL) {
- { /* array: 2 elements */
- /* [1] */
- $"04 00 00 00 20 80 00 2C 0E 02 00 50 11 07 00 00"
- $"51 4A 80 00 11 0A 81 60 0E 0A 82 90 20 9A 40 00"
- $"04 12 40 00 00 12 50 40 00 12 48 80 00 12 47 00"
- $"00 12 47 00 00 12 47 00 FF F2 77 7F 04 12 42 11"
- $"40 52 4F 80 00 12 7F C4 01 12 7F C0 48 12 4F C0"
- $"00 12 47 48 00 12 47 40 00 92 47 42 24 12 4F 80"
- $"00 12 4D 80 00 12 4D 90 20 92 48 82 02 12 48 80"
- $"00 12 58 C0 20 0F 98 C8 00 00 00 00 04 42 22 02",
- /* [2] */
- $"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF"
- $"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF"
- $"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF"
- $"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF"
- $"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF"
- $"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF"
- $"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF"
- $"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF"
- }
- };
-
-